package test.base.medium;

import hyl.base.medium.grab.RtspGrabber;
import hyl.base.medium.Filter.FaceFilter;
import hyl.base.medium.Filter.ImageFilter;
import hyl.base.medium.Filter.RtmpFilter;
import hyl.core.run.MyRun;

public class ffmpegtest3 {
	final static String rtspPath = "rtsp://admin:nt123321@192.168.0.2:554/h264/1/sub/av_stream";
	final static String rtmpPath = "rtmp://192.168.0.147:1935/hyl/te1";

	public static void main(String[] arg) {

		showimg2(rtspPath, 1280, 720);

	}

	public final static MyRun 采集线程池 = MyRun.getInstance("采集流媒体", 2);


	private static void showimg2(String url, int 宽, int 高) {
		采集线程池.execute(() -> {

			RtspGrabber rtsp = new RtspGrabber(url);

			//ImageFilter imgflt = new ImageFilter(宽, 高);
			FaceFilter imgflt= new FaceFilter(宽, 高);
			RtmpFilter rtpflt = new RtmpFilter(rtmpPath, rtsp.get引擎());

			rtsp.set输出图像参数(0, 50, 宽, 高);
			rtsp.load图像过滤器(imgflt);
			//rtsp.load包过滤器(rtpflt);
			rtsp.start();

			rtpflt.close();
			rtsp.close();

		});

	}
}
